\hypertarget{miktexux5b89ux88c5ux8bb0ux5f55}{%
\section{miktex安装记录}\label{miktexux5b89ux88c5ux8bb0ux5f55}}

\href{http://linux-wiki.cn/wiki/LaTeX\%E4\%B8\%AD\%E6\%96\%87\%E6\%8E\%92\%E7\%89\%88\%EF\%BC\%88\%E4\%BD\%BF\%E7\%94\%A8XeTeX\%EF\%BC\%89\#:~:text=LaTeX\%E6\%98\%AF\%E5\%8A\%9F\%E8\%83\%BD,\%E4\%B8\%AD\%E6\%96\%87\%E5\%85\%B6\%E5\%AE\%9E\%E5\%BE\%88\%E7\%AE\%80\%E5\%8D\%95\%E3\%80\%82}{参考}

\hypertarget{ux4e0bux8f7d}{%
\subsection{下载}\label{ux4e0bux8f7d}}

https://miktex.org/download

If you want to create a PDF, you'll need to have LaTeX installed. (See
\href{https://tug.org/mactex/}{MacTeX} on OS X,
\href{https://miktex.org}{MiKTeX} on Windows, or install the texlive
package on Linux.)

\hypertarget{winux5b57ux4f53}{%
\subsection{win字体}\label{winux5b57ux4f53}}

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{C}\NormalTok{:\textbackslash{}Windows\textbackslash{}Fonts}
\end{Highlighting}
\end{Shaded}

\hypertarget{pandoc}{%
\section{pandoc}\label{pandoc}}

https://pandoc.org/getting-started.html

\hypertarget{markdown-to-pdf}{%
\subsection{markdown to pdf}\label{markdown-to-pdf}}

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{{-}{-}latex{-}engine}\NormalTok{=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}template=mytemplate.latex}
\end{Highlighting}
\end{Shaded}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{ 指令例如：}\ExtensionTok{pandoc}\NormalTok{ {-}{-}latex{-}engine=xelatex {-}{-}template=pm{-}template.latex test.md {-}o test.pdf}
\end{Highlighting}
\end{Shaded}

\begin{quote}
https://blog.csdn.net/weixin\_44375591/article/details/103992360

https://jdhao.github.io/2017/12/10/pandoc-markdown-with-chinese/\#\%E5\%A6\%82\%E4\%BD\%95\%E5\%A4\%84\%E7\%90\%86\%E4\%B8\%AD\%E6\%96\%87
\end{quote}

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N  miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue  miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue {-}V geometry:}\StringTok{"top=2cm, bottom=1.5cm, left=2cm, right=2cm"}\NormalTok{  miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue {-}V geometry:}\StringTok{"top=2cm, bottom=1.5cm, left=2cm, right=2cm"}\NormalTok{  {-}H head.tex miktex.md {-}o miktex.pdf}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue {-}V geometry:}\StringTok{"top=2cm, bottom=1.5cm, left=2cm, right=2cm"}\NormalTok{  {-}H head.tex {-}{-}template=template.latex miktex.md {-}o miktex.pdf}

\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue {-}V geometry:}\StringTok{"top=2cm, bottom=1.5cm, left=2cm, right=2cm"}\NormalTok{  {-}H head.tex {-}{-}template=template.latex miktex.md {-}o miktex.tex}

\CommentTok{\# 生成tex供debugger}
\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont=}\StringTok{"STKaiti"}\NormalTok{ {-}{-}highlight{-}style zenburn  {-}{-}toc {-}N {-}V colorlinks {-}V urlcolor=NavyBlue {-}V geometry:}\StringTok{"top=2cm, bottom=1.5cm, left=2cm, right=2cm"}\NormalTok{  miktex.md {-}o miktex.tex}
\end{Highlighting}
\end{Shaded}

\texttt{head.tex}

\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\% change background color for inline code in}
\CommentTok{\% markdown files. The following code does not work well for}
\CommentTok{\% long text as the text will exceed the page boundary}
\FunctionTok{\textbackslash{}definecolor}\NormalTok{\{bgcolor\}\{HTML\}\{E0E0E0\}}
\FunctionTok{\textbackslash{}let\textbackslash{}oldtexttt\textbackslash{}texttt}

\FunctionTok{\textbackslash{}renewcommand}\NormalTok{\{}\ExtensionTok{\textbackslash{}texttt}\NormalTok{\}[1]\{}
  \FunctionTok{\textbackslash{}colorbox}\NormalTok{\{bgcolor\}\{}\FunctionTok{\textbackslash{}oldtexttt}\NormalTok{\{\#1\}\}}
\NormalTok{\}}
\end{Highlighting}
\end{Shaded}

\hypertarget{ux5b89ux88c5}{%
\subsection{安装}\label{ux5b89ux88c5}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{\textbackslash{}}\ExtensionTok{hypertarget}\NormalTok{  gmiflink }
\end{Highlighting}
\end{Shaded}

\hypertarget{environment-shaded-undefined.}{%
\subsubsection{Environment Shaded
undefined.}\label{environment-shaded-undefined.}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  处理保留字符：\texttt{\#\ \$\ \%\ \^{}\ \&\ \_\ \{\ \}\ \textasciitilde{}\ \textbackslash{}}
\item
  添加换行配置

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{\textbackslash{}}\ExtensionTok{documentclass}\DataTypeTok{\{article\}}
\NormalTok{\textbackslash{}}\ExtensionTok{usepackage}\DataTypeTok{\{hyperref\}}
\NormalTok{\textbackslash{}}\ExtensionTok{makeatletter}
\NormalTok{\textbackslash{}}\ExtensionTok{def}\NormalTok{\textbackslash{}UrlAlphabet\{\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{a}\NormalTok{\textbackslash{}do\textbackslash{}b\textbackslash{}do\textbackslash{}c\textbackslash{}do\textbackslash{}d\textbackslash{}do\textbackslash{}e\textbackslash{}do\textbackslash{}f\textbackslash{}do\textbackslash{}g\textbackslash{}do\textbackslash{}h\textbackslash{}do\textbackslash{}i\textbackslash{}do\textbackslash{}j\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{k}\NormalTok{\textbackslash{}do\textbackslash{}l\textbackslash{}do\textbackslash{}m\textbackslash{}do\textbackslash{}n\textbackslash{}do\textbackslash{}o\textbackslash{}do\textbackslash{}p\textbackslash{}do\textbackslash{}q\textbackslash{}do\textbackslash{}r\textbackslash{}do\textbackslash{}s\textbackslash{}do\textbackslash{}t\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{u}\NormalTok{\textbackslash{}do\textbackslash{}v\textbackslash{}do\textbackslash{}w\textbackslash{}do\textbackslash{}x\textbackslash{}do\textbackslash{}y\textbackslash{}do\textbackslash{}z\textbackslash{}do\textbackslash{}A\textbackslash{}do\textbackslash{}B\textbackslash{}do\textbackslash{}C\textbackslash{}do\textbackslash{}D\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{E}\NormalTok{\textbackslash{}do\textbackslash{}F\textbackslash{}do\textbackslash{}G\textbackslash{}do\textbackslash{}H\textbackslash{}do\textbackslash{}I\textbackslash{}do\textbackslash{}J\textbackslash{}do\textbackslash{}K\textbackslash{}do\textbackslash{}L\textbackslash{}do\textbackslash{}M\textbackslash{}do\textbackslash{}N\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{O}\NormalTok{\textbackslash{}do\textbackslash{}P\textbackslash{}do\textbackslash{}Q\textbackslash{}do\textbackslash{}R\textbackslash{}do\textbackslash{}S\textbackslash{}do\textbackslash{}T\textbackslash{}do\textbackslash{}U\textbackslash{}do\textbackslash{}V\textbackslash{}do\textbackslash{}W\textbackslash{}do\textbackslash{}X\%}
\NormalTok{      \textbackslash{}}\KeywordTok{do}\NormalTok{\textbackslash{}}\ExtensionTok{Y}\NormalTok{\textbackslash{}do\textbackslash{}Z\}}
\NormalTok{\textbackslash{}}\ExtensionTok{def}\NormalTok{\textbackslash{}UrlDigits}\DataTypeTok{\{\textbackslash{}do\textbackslash{}1\textbackslash{}do\textbackslash{}2\textbackslash{}do\textbackslash{}3\textbackslash{}do\textbackslash{}4\textbackslash{}do\textbackslash{}5\textbackslash{}do\textbackslash{}6\textbackslash{}do\textbackslash{}7\textbackslash{}do\textbackslash{}8\textbackslash{}do\textbackslash{}9\textbackslash{}do\textbackslash{}0\}}
\NormalTok{\textbackslash{}}\ExtensionTok{g@addto@macro}\DataTypeTok{\{\textbackslash{}UrlBreaks\}\{\textbackslash{}UrlOrds\}}
\NormalTok{\textbackslash{}}\ExtensionTok{g@addto@macro}\DataTypeTok{\{\textbackslash{}UrlBreaks\}\{\textbackslash{}UrlAlphabet\}}
\NormalTok{\textbackslash{}}\ExtensionTok{g@addto@macro}\DataTypeTok{\{\textbackslash{}UrlBreaks\}\{\textbackslash{}UrlDigits\}}
\NormalTok{\textbackslash{}}\ExtensionTok{makeatother}
\NormalTok{\textbackslash{}}\ExtensionTok{begin}\DataTypeTok{\{document\}}
\NormalTok{\textbackslash{}}\ExtensionTok{url}\DataTypeTok{\{http://foo.bar.com/documentclassarticleusepackagehyperrefbegindocumenturlenddocument\}}
\NormalTok{\textbackslash{}}\ExtensionTok{end}\DataTypeTok{\{document\}}
\end{Highlighting}
\end{Shaded}
\item
\end{enumerate}

\hypertarget{pdf}{%
\subsection{pdf}\label{pdf}}

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{pandoc}\NormalTok{ wsl打造arch开发环境.md {-}o test.pdf {-}{-}pdf{-}engine=xelatex {-}v mainfont=}\StringTok{"Microsoft YaHei"}

\ExtensionTok{pandoc}\NormalTok{ miktex.md {-}o test.pdf {-}{-}pdf{-}engine=xelatex {-}v mainfont=}\StringTok{"Microsoft YaHei"}\NormalTok{  {-}c auto{-}title{-}number.css}

\ExtensionTok{pandoc}\NormalTok{ wsl打造arch开发环境.md {-}o test.pdf {-}{-}pdf{-}engine=xelatex {-}v mainfont=}\StringTok{"Microsoft YaHei"}\NormalTok{  {-}c auto{-}title{-}number.css}

\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont==}\StringTok{"Microsoft YaHei"}\NormalTok{  {-}c auto{-}title{-}number.css  wsl打造arch开发环境.md {-}o test.pdf}

\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont==}\StringTok{"Microsoft YaHei"}\NormalTok{  {-}c auto{-}title{-}number.css {-}{-}listings wsl打造arch开发环境.md {-}o test.pdf}


\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex {-}V CJKmainfont==}\StringTok{"Microsoft YaHei"}\NormalTok{  {-}c auto{-}title{-}number.css {-}{-}listings miktex.md {-}o test.pdf}


\ExtensionTok{pandoc}\NormalTok{ {-}{-}pdf{-}engine=xelatex  {-}s {-}{-}highlight{-}style kate  {-}V CJKmainfont=}\StringTok{\textquotesingle{}黑体\textquotesingle{}}\NormalTok{ {-}V mainfont=}\StringTok{\textquotesingle{}Times New Roman\textquotesingle{}}\NormalTok{ {-}V geometry:margin=1in  {-}c auto{-}title{-}number.css {-}{-}listings miktex.md {-}o test.pdf}
\end{Highlighting}
\end{Shaded}

参考

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{pandoc}\NormalTok{ {-}N {-}s {-}{-}toc {-}{-}smart {-}{-}latex{-}engine=xelatex {-}V CJKmainfont=}\StringTok{\textquotesingle{}黑体\textquotesingle{}}\NormalTok{ {-}V mainfont=}\StringTok{\textquotesingle{}Times New Roman\textquotesingle{}}\NormalTok{ {-}V geometry:margin=1in input.md {-}o output.pdf}
\end{Highlighting}
\end{Shaded}

\begin{verbatim}
---
title: "miktex安装记录"
author: sloera
date: "2021-03-11"
subject: "Markdown"
keywords: [miktex,pandoc]
header-includes:
 - \lstset{breaklines=true}
 - \lstset{keywordstyle=\bfseries}
 - \lstset{commentstyle=\rmfamily\itshape}
 - \lstset{flexiblecolumns}
 - \lstset{showspaces=false}
 - \lstset{frame=shadowbox}
---
\end{verbatim}

\hypertarget{archux914dux7f6e}{%
\section{arch配置}\label{archux914dux7f6e}}

\begin{quote}
http://linux-wiki.cn/wiki/LaTeX\%E4\%B8\%AD\%E6\%96\%87\%E6\%8E\%92\%E7\%89\%88\%EF\%BC\%88\%E4\%BD\%BF\%E7\%94\%A8XeTeX\%EF\%BC\%89\#:\textasciitilde:text=LaTeX\%E6\%98\%AF\%E5\%8A\%9F\%E8\%83\%BD,\%E4\%B8\%AD\%E6\%96\%87\%E5\%85\%B6\%E5\%AE\%9E\%E5\%BE\%88\%E7\%AE\%80\%E5\%8D\%95\%E3\%80\%82
\end{quote}

\hypertarget{ux5b57ux4f53}{%
\subsection{字体}\label{ux5b57ux4f53}}

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{noto{-}fonts{-}cjk}
\CommentTok{\#查看字体}
\ExtensionTok{fc{-}list}\NormalTok{ :lang=zh}
\end{Highlighting}
\end{Shaded}

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{sudo}\NormalTok{ pacman {-}S noto{-}fonts{-}cjk wqy{-}microhei wqy{-}microhei{-}lite wqy{-}bitmapfont}
\FunctionTok{sudo}\NormalTok{ pacman {-}S wqy{-}zenhei ttf{-}arphic{-}ukai ttf{-}arphic{-}uming adobe{-}source{-}han{-}sans{-}cn{-}fonts adobe{-}source{-}han{-}serif{-}cn{-}fonts}
\end{Highlighting}
\end{Shaded}

\hypertarget{ux5b89ux88c5text}{%
\subsection{安装text}\label{ux5b89ux88c5text}}

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{sudo}\NormalTok{ pacman {-}S texlive{-}most}
\end{Highlighting}
\end{Shaded}

\hypertarget{ux793aux4f8b}{%
\subsection{示例}\label{ux793aux4f8b}}

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{mkdir}\NormalTok{ latex}
\BuiltInTok{cd}\NormalTok{ latex}
\ExtensionTok{vim}\NormalTok{ hello.tex}
\FunctionTok{cat}\NormalTok{ hello.tex}
\NormalTok{\textbackslash{}}\ExtensionTok{documentclass}\DataTypeTok{\{article\}}
\NormalTok{\textbackslash{}}\ExtensionTok{begin}\DataTypeTok{\{document\}}
\ExtensionTok{Hello}\NormalTok{ Latex!}
\NormalTok{\textbackslash{}}\ExtensionTok{end}\DataTypeTok{\{document\}}
\CommentTok{\# end}
\ExtensionTok{pdflatex}\NormalTok{ hello.tex}
\ExtensionTok{explorer.exe}\NormalTok{  .}
\end{Highlighting}
\end{Shaded}

\hypertarget{ux5b89ux88c5ux6269ux5c55ux5305}{%
\subsection{安装扩展包}\label{ux5b89ux88c5ux6269ux5c55ux5305}}

\begin{quote}
https://ctan.org/pkg
\end{quote}

\texttt{/usr/share/texmf-dist/tex/xelatex}
